package com.feihao.demo2;

import java.util.Random;

public class Test {
    public static void main(String[] args) {
        Role role = new Role();
        role.setName("张三");
        role.setAge(23);

        role.setSkill(new Skill() {
            @Override
            public void skill() {
                System.out.println("大闹天宫");
            }
        });


        role.setSkill(new Skill() {
            @Override
            public void skill() {
                System.out.println("日日日日日日");
            }
        });


        role.useSkill();
    }
}
